# Define the correct MIME type for specific languages
AddType text/html .bn
AddType text/html .el
AddType text/html .nb
AddType text/html .pl
AddType text/html .es
AddType text/html .tr
AddType text/html .sr
AddType text/html .si
AddType text/html .pt
 
AddLanguage af .af
AddLanguage ar .ar
AddLanguage as .as
AddLanguage ast .ast
AddLanguage az .az
AddLanguage bg .bg
AddLanguage bn .bn
AddLanguage bn-in .bn_IN
AddLanguage br .br
AddLanguage ca .ca
AddLanguage cs .cs
AddLanguage da .da
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage es .es
AddLanguage eu .eu
AddLanguage fa .fa
AddLanguage fi .fi
AddLanguage fr .fr
AddLanguage gl .gl
AddLanguage gu .gu
AddLanguage he .he
AddLanguage hi .hi
AddLanguage hu .hu
AddLanguage ia .ia
AddLanguage id .id
AddLanguage is .is
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ka .ka
AddLanguage km .km
AddLanguage ko .ko
AddLanguage lv .lv
AddLanguage ml .ml
AddLanguage mr .mr
AddLanguage nb .nb
AddLanguage nl .nl
AddLanguage pa .pa
AddLanguage pl .pl
AddLanguage pt .pt
AddLanguage pt-br .pt_BR
AddLanguage ro .ro
AddLanguage ru .ru
AddLanguage si .si
AddLanguage sk .sk
AddLanguage sq .sq
AddLanguage sr .sr
AddLanguage sv .sv
AddLanguage ta .ta
AddLanguage te .te
AddLanguage tg .tg
AddLanguage tr .tr
AddLanguage uk .uk
AddLanguage vi .vi
AddLanguage zh-cn .zh_Hans_CN
AddLanguage zh-tw .zh_Hant_TW

LanguagePriority en
ForceLanguagePriority Prefer Fallback

AddDefaultCharset utf-8

RewriteEngine on

RewriteCond %{QUERY_STRING} ^lang=(af|ar|as|ast|az|bg|bn|bn_IN|br|ca|cs|da|de|el|en|es|eu|fa|fi|fr|gl|gu|he|hi|hu|ia|id|is|it|ja|ka|km|ko|lv|ml|mr|nb|nl|pa|pl|pt|pt_BR|ro|ru|si|sk|sq|sr|sv|ta|te|tg|tr|uk|vi|zh_Hans_CN|zh_Hant_TW)$
RewriteRule ^(?:/(?:af|ar|as|ast|az|bg|bn|bn_IN|br|ca|cs|da|de|el|en|es|eu|fa|fi|fr|gl|gu|he|hi|hu|ia|id|is|it|ja|ka|km|ko|lv|ml|mr|nb|nl|pa|pl|pt|pt_BR|ro|ru|si|sk|sq|sr|sv|ta|te|tg|tr|uk|vi|zh_Hans_CN|zh_Hant_TW))?(/.*)$ /%1$1? [R=301]
AliasMatch ^(?:/(?:af|ar|as|ast|az|bg|bn|bn_IN|br|ca|cs|da|de|el|en|es|eu|fa|fi|fr|gl|gu|he|hi|hu|ia|id|is|it|ja|ka|km|ko|lv|ml|mr|nb|nl|pa|pl|pt|pt_BR|ro|ru|si|sk|sq|sr|sv|ta|te|tg|tr|uk|vi|zh_Hans_CN|zh_Hant_TW))(/.*)?$ /srv/web/spins.fedoraproject.org$1

<Directory /srv/web/spins.fedoraproject.org>
  Options MultiViews

  SetEnvIf Request_URI ^/af/ prefer-language=af
  SetEnvIf Request_URI ^/ar/ prefer-language=ar
  SetEnvIf Request_URI ^/as/ prefer-language=as
  SetEnvIf Request_URI ^/ast/ prefer-language=ast
  SetEnvIf Request_URI ^/az/ prefer-language=az
  SetEnvIf Request_URI ^/bg/ prefer-language=bg
  SetEnvIf Request_URI ^/bn/ prefer-language=bn
  SetEnvIf Request_URI ^/bn_IN/ prefer-language=bn-in
  SetEnvIf Request_URI ^/br/ prefer-language=br
  SetEnvIf Request_URI ^/ca/ prefer-language=ca
  SetEnvIf Request_URI ^/cs/ prefer-language=cs
  SetEnvIf Request_URI ^/da/ prefer-language=da
  SetEnvIf Request_URI ^/de/ prefer-language=de
  SetEnvIf Request_URI ^/el/ prefer-language=el
  SetEnvIf Request_URI ^/en/ prefer-language=en
  SetEnvIf Request_URI ^/es/ prefer-language=es
  SetEnvIf Request_URI ^/eu/ prefer-language=eu
  SetEnvIf Request_URI ^/fa/ prefer-language=fa
  SetEnvIf Request_URI ^/fi/ prefer-language=fi
  SetEnvIf Request_URI ^/fr/ prefer-language=fr
  SetEnvIf Request_URI ^/gl/ prefer-language=gl
  SetEnvIf Request_URI ^/gu/ prefer-language=gu
  SetEnvIf Request_URI ^/he/ prefer-language=he
  SetEnvIf Request_URI ^/hi/ prefer-language=hi
  SetEnvIf Request_URI ^/hu/ prefer-language=hu
  SetEnvIf Request_URI ^/ia/ prefer-language=ia
  SetEnvIf Request_URI ^/id/ prefer-language=id
  SetEnvIf Request_URI ^/is/ prefer-language=is
  SetEnvIf Request_URI ^/it/ prefer-language=it
  SetEnvIf Request_URI ^/ja/ prefer-language=ja
  SetEnvIf Request_URI ^/ka/ prefer-language=ka
  SetEnvIf Request_URI ^/km/ prefer-language=km
  SetEnvIf Request_URI ^/ko/ prefer-language=ko
  SetEnvIf Request_URI ^/lv/ prefer-language=lv
  SetEnvIf Request_URI ^/ml/ prefer-language=ml
  SetEnvIf Request_URI ^/mr/ prefer-language=mr
  SetEnvIf Request_URI ^/nb/ prefer-language=nb
  SetEnvIf Request_URI ^/nl/ prefer-language=nl
  SetEnvIf Request_URI ^/pa/ prefer-language=pa
  SetEnvIf Request_URI ^/pl/ prefer-language=pl
  SetEnvIf Request_URI ^/pt/ prefer-language=pt
  SetEnvIf Request_URI ^/pt_BR/ prefer-language=pt-br
  SetEnvIf Request_URI ^/ro/ prefer-language=ro
  SetEnvIf Request_URI ^/ru/ prefer-language=ru
  SetEnvIf Request_URI ^/si/ prefer-language=si
  SetEnvIf Request_URI ^/sk/ prefer-language=sk
  SetEnvIf Request_URI ^/sq/ prefer-language=sq
  SetEnvIf Request_URI ^/sr/ prefer-language=sr
  SetEnvIf Request_URI ^/sv/ prefer-language=sv
  SetEnvIf Request_URI ^/ta/ prefer-language=ta
  SetEnvIf Request_URI ^/te/ prefer-language=te
  SetEnvIf Request_URI ^/tg/ prefer-language=tg
  SetEnvIf Request_URI ^/tr/ prefer-language=tr
  SetEnvIf Request_URI ^/uk/ prefer-language=uk
  SetEnvIf Request_URI ^/vi/ prefer-language=vi
  SetEnvIf Request_URI ^/zh_Hans_CN/ prefer-language=zh-cn
  SetEnvIf Request_URI ^/zh_Hant_TW/ prefer-language=zh-tw
</Directory>
